home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2003 September / PC Answers September 2003.iso / Software / freeware / pixeltoolbox / Setup.exe / Main / PixelToolbox.exe / PixelToolbox.dxr / Scripts_45_weave script.ls < prev    next >
Encoding:
Text File  |  2002-06-08  |  16.9 KB  |  259 lines

  1. global gSize, gCast, myCurrentImage, myCurrentPreview, gWvBgColor, gWvBgShadow, gWvVcolor, gWvVShadow, gWvHcolor, gWvHShadow, weaveSubVar
  2.  
  3. on applyFastWeave
  4.   if sprite(4).left <> 800 then
  5.     alert("Fast Weave does not work on selections.")
  6.     pass()
  7.   end if
  8.   cursor(4)
  9.   if sprite(1).pUndoTrigger = 0 then
  10.     sprite(1).pUndoTrigger = 1
  11.   end if
  12.   member("state1 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
  13.   myCurrentImage = duplicate(member(gSize & "x" & gSize, gCast).image)
  14.   myCurrentPreview = duplicate(member("preview", gCast).image)
  15.   if sprite(158).blend = 100 then
  16.     myCurrentImage.fill(myCurrentImage.rect, gWvBgColor)
  17.   end if
  18.   if sprite(159).blend = 100 then
  19.     l = -integer(the text of field "weave V width") + integer(the text of field "weave depth") + 1 - (integer(the text of field "weave V space") * 8)
  20.     r = l + integer(the text of field "weave V width")
  21.     myCurrentImage.fill(rect(l, 0, r, myCurrentImage.height), gWvBgShadow)
  22.     repeat while r < myCurrentImage.width
  23.       l = l + integer(the text of field "weave V space")
  24.       r = l + integer(the text of field "weave V width")
  25.       myCurrentImage.fill(rect(l, 0, r, myCurrentImage.height), gWvBgShadow)
  26.     end repeat
  27.     t = -integer(the text of field "weave H width") + integer(the text of field "weave depth") + 1 - (integer(the text of field "weave H space") * 8)
  28.     b = t + integer(the text of field "weave H width")
  29.     myCurrentImage.fill(rect(0, t, myCurrentImage.width, b), gWvBgShadow)
  30.     repeat while b < myCurrentImage.height
  31.       t = t + integer(the text of field "weave H space")
  32.       b = t + integer(the text of field "weave H width")
  33.       myCurrentImage.fill(rect(0, t, myCurrentImage.width, b), gWvBgShadow)
  34.     end repeat
  35.   end if
  36.   l = -integer(the text of field "weave V width")
  37.   t = -integer(the text of field "weave H space")
  38.   r = l + integer(the text of field "weave V width")
  39.   b = t + (integer(the text of field "weave H space") * 2) + integer(the text of field "weave H width")
  40.   repeat while r < (myCurrentImage.width + (integer(the text of field "weave V space") * 2))
  41.     repeat while b < (myCurrentImage.height + (integer(the text of field "weave H space") * 2))
  42.       myCurrentImage.fill(rect(l, t, r, b), gWvVcolor)
  43.       t = t + (integer(the text of field "weave H space") * 2)
  44.       b = t + (integer(the text of field "weave H space") * 2) - integer(the text of field "weave H width")
  45.     end repeat
  46.     l = l + integer(the text of field "weave V space")
  47.     t = 0
  48.     r = l + integer(the text of field "weave V width")
  49.     b = t + (integer(the text of field "weave H space") * 2) - integer(the text of field "weave H width")
  50.     repeat while b < (myCurrentImage.height + (integer(the text of field "weave H space") * 2))
  51.       myCurrentImage.fill(rect(l, t, r, b), gWvVcolor)
  52.       t = t + (integer(the text of field "weave H space") * 2)
  53.       b = t + (integer(the text of field "weave H space") * 2) - integer(the text of field "weave H width")
  54.     end repeat
  55.     l = l + integer(the text of field "weave V space")
  56.     t = -integer(the text of field "weave H space")
  57.     r = l + integer(the text of field "weave V width")
  58.     b = t + (integer(the text of field "weave H space") * 2) - integer(the text of field "weave H width")
  59.   end repeat
  60.   l = -integer(the text of field "weave V width")
  61.   t = -integer(the text of field "weave H space") + integer(the text of field "weave depth") - integer(the text of field "weave H width") - (integer(the text of field "weave H space") * 8)
  62.   r = l + integer(the text of field "weave V width")
  63.   b = t + integer(the text of field "weave H width")
  64.   repeat while r < (myCurrentImage.width + (integer(the text of field "weave V space") * 2))
  65.     repeat while b < (myCurrentImage.height + (integer(the text of field "weave depth") * 2))
  66.       myCurrentImage.fill(rect(l, t, r, b), gWvVShadow)
  67.       t = t + (integer(the text of field "weave H space") * 2)
  68.       b = t + integer(the text of field "weave H width")
  69.     end repeat
  70.     l = l + integer(the text of field "weave V space")
  71.     t = 0 + integer(the text of field "weave depth") - integer(the text of field "weave H width") - (integer(the text of field "weave H space") * 8)
  72.     r = l + integer(the text of field "weave V width")
  73.     b = t + integer(the text of field "weave H width")
  74.     repeat while b < (myCurrentImage.height + (integer(the text of field "weave depth") * 2))
  75.       myCurrentImage.fill(rect(l, t, r, b), gWvVShadow)
  76.       t = t + (integer(the text of field "weave H space") * 2)
  77.       b = t + integer(the text of field "weave H width")
  78.     end repeat
  79.     l = l + integer(the text of field "weave V space")
  80.     t = -integer(the text of field "weave H space") + integer(the text of field "weave depth") - integer(the text of field "weave H width") - (integer(the text of field "weave H space") * 8)
  81.     r = l + integer(the text of field "weave V width")
  82.     b = t + integer(the text of field "weave H width")
  83.   end repeat
  84.   t = -integer(the text of field "weave H width")
  85.   l = 0
  86.   b = t + integer(the text of field "weave H width")
  87.   r = l + (integer(the text of field "weave V space") * 2) - integer(the text of field "weave V width")
  88.   repeat while b < (myCurrentImage.height + (integer(the text of field "weave H space") * 2))
  89.     repeat while r < (myCurrentImage.width + (integer(the text of field "weave V space") * 2))
  90.       myCurrentImage.fill(rect(l, t, r, b), gWvHcolor)
  91.       l = l + (integer(the text of field "weave V space") * 2)
  92.       r = l + (integer(the text of field "weave V space") * 2) - integer(the text of field "weave V width")
  93.     end repeat
  94.     t = t + integer(the text of field "weave H space")
  95.     l = -integer(the text of field "weave V space")
  96.     b = t + integer(the text of field "weave H width")
  97.     r = l + (integer(the text of field "weave V space") * 2) - integer(the text of field "weave V width")
  98.     repeat while r < (myCurrentImage.width + (integer(the text of field "weave V space") * 2))
  99.       myCurrentImage.fill(rect(l, t, r, b), gWvHcolor)
  100.       l = l + (integer(the text of field "weave V space") * 2)
  101.       r = l + (integer(the text of field "weave V space") * 2) - integer(the text of field "weave V width")
  102.     end repeat
  103.     t = t + integer(the text of field "weave H space")
  104.     l = 0
  105.     b = t + integer(the text of field "weave H width")
  106.     r = l + (integer(the text of field "weave V space") * 2) - integer(the text of field "weave V width")
  107.   end repeat
  108.   if (integer(the text of field "weave depth") = 0) or (integer(the text of field "weave depth") = (integer(the text of field "weave V space") * 2)) or (integer(the text of field "weave depth") = (integer(the text of field "weave V space") * 4)) or (integer(the text of field "weave depth") = (integer(the text of field "weave V space") * 6)) or (integer(the text of field "weave depth") = (integer(the text of field "weave V space") * 8)) then
  109.     nothing()
  110.   else
  111.     if integer(the text of field "weave depth") < integer(the text of field "weave V width") then
  112.       weaveSubVar = 0
  113.       HShadowBegin()
  114.     else
  115.       if (integer(the text of field "weave depth") >= integer(the text of field "weave V width")) and (integer(the text of field "weave depth") <= ((integer(the text of field "weave V space") * 2) - integer(the text of field "weave V width"))) then
  116.         HShadowSpan()
  117.       else
  118.         if (integer(the text of field "weave depth") > ((integer(the text of field "weave V space") * 2) - integer(the text of field "weave V width"))) and (integer(the text of field "weave depth") < (integer(the text of field "weave V space") * 2)) then
  119.           weaveSubVar = 0
  120.           HShadowEnd()
  121.         else
  122.           if (integer(the text of field "weave depth") > (integer(the text of field "weave V space") * 2)) and (integer(the text of field "weave depth") < ((integer(the text of field "weave V space") * 2) + integer(the text of field "weave V width"))) then
  123.             weaveSubVar = integer(the text of field "weave V space") * 2
  124.             HShadowBegin()
  125.           else
  126.             if (integer(the text of field "weave depth") >= ((integer(the text of field "weave V space") * 2) + integer(the text of field "weave V width"))) and (integer(the text of field "weave depth") <= ((integer(the text of field "weave V space") * 4) - integer(the text of field "weave V width"))) then
  127.               HShadowSpan()
  128.             else
  129.               if (integer(the text of field "weave depth") > ((integer(the text of field "weave V space") * 4) - integer(the text of field "weave V width"))) and (integer(the text of field "weave depth") < (integer(the text of field "weave V space") * 4)) then
  130.                 weaveSubVar = integer(the text of field "weave V space") * 2
  131.                 HShadowEnd()
  132.               else
  133.                 if (integer(the text of field "weave depth") > (integer(the text of field "weave V space") * 4)) and (integer(the text of field "weave depth") < ((integer(the text of field "weave V space") * 4) + integer(the text of field "weave V width"))) then
  134.                   weaveSubVar = integer(the text of field "weave V space") * 4
  135.                   HShadowBegin()
  136.                 else
  137.                   if (integer(the text of field "weave depth") >= ((integer(the text of field "weave V space") * 4) + integer(the text of field "weave V width"))) and (integer(the text of field "weave depth") <= ((integer(the text of field "weave V space") * 6) - integer(the text of field "weave V width"))) then
  138.                     HShadowSpan()
  139.                   else
  140.                     if (integer(the text of field "weave depth") > ((integer(the text of field "weave V space") * 6) - integer(the text of field "weave V width"))) and (integer(the text of field "weave depth") < (integer(the text of field "weave V space") * 6)) then
  141.                       weaveSubVar = integer(the text of field "weave V space") * 4
  142.                       HShadowEnd()
  143.                     else
  144.                       if (integer(the text of field "weave depth") > (integer(the text of field "weave V space") * 6)) and (integer(the text of field "weave depth") < ((integer(the text of field "weave V space") * 6) + integer(the text of field "weave V width"))) then
  145.                         weaveSubVar = integer(the text of field "weave V space") * 6
  146.                         HShadowBegin()
  147.                       else
  148.                         if (integer(the text of field "weave depth") >= ((integer(the text of field "weave V space") * 6) + integer(the text of field "weave V width"))) and (integer(the text of field "weave depth") <= ((integer(the text of field "weave V space") * 8) - integer(the text of field "weave V width"))) then
  149.                           HShadowSpan()
  150.                         else
  151.                           if (integer(the text of field "weave depth") > ((integer(the text of field "weave V space") * 8) - integer(the text of field "weave V width"))) and (integer(the text of field "weave depth") < (integer(the text of field "weave V space") * 8)) then
  152.                             weaveSubVar = integer(the text of field "weave V space") * 6
  153.                             HShadowEnd()
  154.                           end if
  155.                         end if
  156.                       end if
  157.                     end if
  158.                   end if
  159.                 end if
  160.               end if
  161.             end if
  162.           end if
  163.         end if
  164.       end if
  165.     end if
  166.   end if
  167.   member(gSize & "x" & gSize, gCast).image.copyPixels(myCurrentImage, myCurrentImage.rect, myCurrentImage.rect)
  168.   updateStage()
  169.   fnUpdatePreview()
  170.   sprite(35).pState = 0
  171.   sendSprite(35, #setMember)
  172.   member("state2 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
  173.   weaveSubVar = VOID
  174.   myCurrentImage = VOID
  175.   myCurrentPreview = VOID
  176.   cursor(0)
  177. end
  178.  
  179. on HShadowBegin
  180.   t = -integer(the text of field "weave H width")
  181.   l = 0
  182.   b = t + integer(the text of field "weave H width")
  183.   r = l + (integer(the text of field "weave depth") - weaveSubVar)
  184.   repeat while b < (myCurrentImage.height + (integer(the text of field "weave H space") * 2))
  185.     repeat while r < (myCurrentImage.width + (integer(the text of field "weave depth") * 2))
  186.       myCurrentImage.fill(rect(l, t, r, b), gWvHShadow)
  187.       l = l + (integer(the text of field "weave V space") * 2)
  188.       r = l + (integer(the text of field "weave depth") - weaveSubVar)
  189.     end repeat
  190.     t = t + integer(the text of field "weave H space")
  191.     l = -integer(the text of field "weave V space")
  192.     b = t + integer(the text of field "weave H width")
  193.     r = l + (integer(the text of field "weave depth") - weaveSubVar)
  194.     repeat while r < (myCurrentImage.width + (integer(the text of field "weave depth") * 2))
  195.       myCurrentImage.fill(rect(l, t, r, b), gWvHShadow)
  196.       l = l + (integer(the text of field "weave V space") * 2)
  197.       r = l + (integer(the text of field "weave depth") - weaveSubVar)
  198.     end repeat
  199.     t = t + integer(the text of field "weave H space")
  200.     l = 0
  201.     b = t + integer(the text of field "weave H width")
  202.     r = l + (integer(the text of field "weave depth") - weaveSubVar)
  203.   end repeat
  204. end
  205.  
  206. on HShadowSpan
  207.   t = -integer(the text of field "weave H width")
  208.   l = 0 + integer(the text of field "weave depth") - integer(the text of field "weave V width") - (integer(the text of field "weave V space") * 8)
  209.   b = t + integer(the text of field "weave H width")
  210.   r = l + integer(the text of field "weave V width")
  211.   repeat while b < (myCurrentImage.height + (integer(the text of field "weave H space") * 2))
  212.     repeat while r < (myCurrentImage.width + (integer(the text of field "weave depth") * 2))
  213.       myCurrentImage.fill(rect(l, t, r, b), gWvHShadow)
  214.       l = l + (integer(the text of field "weave V space") * 2)
  215.       r = l + integer(the text of field "weave V width")
  216.     end repeat
  217.     t = t + integer(the text of field "weave H space")
  218.     l = -integer(the text of field "weave V space") + integer(the text of field "weave depth") - integer(the text of field "weave V width") - (integer(the text of field "weave V space") * 8)
  219.     b = t + integer(the text of field "weave H width")
  220.     r = l + integer(the text of field "weave V width")
  221.     repeat while r < (myCurrentImage.width + (integer(the text of field "weave depth") * 2))
  222.       myCurrentImage.fill(rect(l, t, r, b), gWvHShadow)
  223.       l = l + (integer(the text of field "weave V space") * 2)
  224.       r = l + integer(the text of field "weave V width")
  225.     end repeat
  226.     t = t + integer(the text of field "weave H space")
  227.     l = 0 + integer(the text of field "weave depth") - integer(the text of field "weave V width") - (integer(the text of field "weave V space") * 8)
  228.     b = t + integer(the text of field "weave H width")
  229.     r = l + integer(the text of field "weave V width")
  230.   end repeat
  231. end
  232.  
  233. on HShadowEnd
  234.   t = -integer(the text of field "weave H width")
  235.   l = 0 + (integer(the text of field "weave depth") - weaveSubVar) - integer(the text of field "weave V width") - (integer(the text of field "weave V space") * 8)
  236.   b = t + integer(the text of field "weave H width")
  237.   r = l + integer(the text of field "weave V width") - (integer(the text of field "weave depth") - weaveSubVar - ((integer(the text of field "weave V space") * 2) - integer(the text of field "weave V width")))
  238.   repeat while b < (myCurrentImage.height + (integer(the text of field "weave H space") * 2))
  239.     repeat while r < (myCurrentImage.width + (integer(the text of field "weave depth") * 2))
  240.       myCurrentImage.fill(rect(l, t, r, b), gWvHShadow)
  241.       l = l + (integer(the text of field "weave V space") * 2)
  242.       r = l + integer(the text of field "weave V width") - (integer(the text of field "weave depth") - weaveSubVar - ((integer(the text of field "weave V space") * 2) - integer(the text of field "weave V width")))
  243.     end repeat
  244.     t = t + integer(the text of field "weave H space")
  245.     l = -integer(the text of field "weave V space") + (integer(the text of field "weave depth") - weaveSubVar) - integer(the text of field "weave V width") - (integer(the text of field "weave V space") * 8)
  246.     b = t + integer(the text of field "weave H width")
  247.     r = l + integer(the text of field "weave V width") - (integer(the text of field "weave depth") - weaveSubVar - ((integer(the text of field "weave V space") * 2) - integer(the text of field "weave V width")))
  248.     repeat while r < (myCurrentImage.width + (integer(the text of field "weave depth") * 2))
  249.       myCurrentImage.fill(rect(l, t, r, b), gWvHShadow)
  250.       l = l + (integer(the text of field "weave V space") * 2)
  251.       r = l + integer(the text of field "weave V width") - (integer(the text of field "weave depth") - weaveSubVar - ((integer(the text of field "weave V space") * 2) - integer(the text of field "weave V width")))
  252.     end repeat
  253.     t = t + integer(the text of field "weave H space")
  254.     l = 0 + (integer(the text of field "weave depth") - weaveSubVar) - integer(the text of field "weave V width") - (integer(the text of field "weave V space") * 8)
  255.     b = t + integer(the text of field "weave H width")
  256.     r = l + integer(the text of field "weave V width") - (integer(the text of field "weave depth") - weaveSubVar - ((integer(the text of field "weave V space") * 2) - integer(the text of field "weave V width")))
  257.   end repeat
  258. end
  259.